package study.saas.order.facade.impl;

import com.alibaba.dubbo.config.annotation.Service;
import org.springframework.stereotype.Component;
import study.saas.common.viewmodel.ApiResultV2;
import study.saas.common.viewmodel.PageModel;
import study.saas.order.entity.Purchase;
import study.saas.order.service.PurchaseFacade;
import study.saas.order.service.PurchaseService;
import study.saas.order.service.model.PurchaseConditionDTO;
import study.saas.order.service.model.PurchaseCreateDTO;
import study.saas.order.service.model.PurchaseFilterDTO;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author HuBoyu
 */


@Service(version = "1.0.0")
@Component("purchaseFacade")

public class PurchaseFacadeImpl implements PurchaseFacade {

    @Resource
    private PurchaseService service;

    @Override
    public ApiResultV2<List<Purchase>> selectAll() {
        return service.selectAll();
    }

    @Override
    public ApiResultV2<Purchase> get(Integer purchaseId) {
        return service.get(purchaseId);
    }

    @Override
    public ApiResultV2<PageModel<Purchase>> list(PurchaseFilterDTO filter) {
        return service.list(filter);
    }

    @Override
    public ApiResultV2<Purchase> purchaseCreate(PurchaseCreateDTO purchaseCreate) {
        return service.purchaseCreate(purchaseCreate);
    }

    @Override
    public ApiResultV2<Purchase> deletePurchase(Integer purchaseId) {
        return service.deletePurchase(purchaseId);
    }

    @Override
    public ApiResultV2<PageModel<Purchase>> conditionList(PurchaseConditionDTO filter) {
        return  service.conditionList(filter);
    }


}
